﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DataSetTableAdapters;

public partial class register : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void registerButton_Click(object sender, ImageClickEventArgs e)
    {
        if (pwdTextBox.Text != pwd2TextBox.Text)
        {
            errLabel.Text = "密码不一致";
            return;
        }
        if (emailTextBox.Text.Equals(""))
        {
            errLabel.Text = "邮件不能为空";
            return;
        }
        if (pwdTextBox.Text.Equals(""))
        {
            errLabel.Text = "密码不能为空";
            return;
        }
        if (userNameTextBox.Text.Equals(""))
        {
            errLabel.Text = "用户名不能为空";
            return;
        }
        QueriesTableAdapter adapter = new QueriesTableAdapter();
        int? isErr = null;
        adapter.RegisterMember(emailTextBox.Text,
        userNameTextBox.Text,null,
        pwdTextBox.Text, 
        null,
        null,
        null,
        null,
        null,
        ref isErr);
        if (isErr == 1)
        {
            errLabel.Text = "注册成功";
        }
        else
        {
            errLabel.Text = "Email存在";
        }
    }

}